package cn.gson.fengboot.model.pojos;

import javax.persistence.*;
import java.util.Collection;
import java.util.Objects;

@Entity
public class Qproduct {
    private int productId;
    private String productName;
    private Collection<Qproductdetail> qproductdetailprodetailId;

    @OneToMany(mappedBy = "productId")
    public Collection<Qproductdetail> getQproductdetailprodetailId() {
        return qproductdetailprodetailId;
    }
    public void setQproductdetailprodetailId(Collection<Qproductdetail> qproductdetailprodetailId) {
        this.qproductdetailprodetailId = qproductdetailprodetailId;
    }


    @Id
    @Column(name = "product_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getProductId() {
        return productId;
    }

    public void setProductId(int productId) {
        this.productId = productId;
    }

    @Basic
    @Column(name = "product_name")
    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Qproduct qproduct = (Qproduct) o;
        return productId == qproduct.productId &&
                Objects.equals(productName, qproduct.productName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(productId, productName);
    }
}
